@include('Home.head')
<style>
	.choose {
	    position: relative;
	}
	
	.choose .radio {
	    position: relative;
	    display: inline-block;
	    font-weight: 400;
	    color: #0c4757;
	    padding-left: 25px;
	    cursor: pointer;
	}
	
	.choose .radio input {
	    position: absolute;
	    left: -9999px;
	}
	
	.choose .radio i {
	    display: block;
	    position: absolute;
	    top: 6px;
	    left: 0;
	    width: 15px;
	    height: 15px;
	    outline: 0;
	    border: 1px solid #e4e4e4;
	    background: #ffffff;
	    border-radius: 50%;
	    transition: border-color .3s;
	    -webkit-transition: border-color .3s;
	}
	
	.choose .radio input + i:after {
	    position: absolute;
	    content: '';
	    top: 2px;
	    left: 2px;
	    width: 9px;
	    height: 9px;
	    border-radius: 50%;
	    background-color: #ff5d5b;
	    opacity: 0;
	    transition: opacity .1s;
	    -webkit-transition: opacity .1s;
	}
	
	.choose .radio input:checked + i:after {
	    opacity: 1;
	}
	.dot-ani {
	      display: inline-block;
	      height: 12px;
	      line-height: 12px;
	      overflow: hidden;
	    }
	    .dot-ani::after {
	      display: inline-table;
	      white-space: pre;
	      content: "\A.\A..\A...";
	      animation: spin 2s steps(4) infinite;
	    }
	    @keyframes spin {
	      to{
	        -webkit-transform:translateY(-48px);
	        transform:translateY(-48px)
	      }
	    }
		a:active {
		color:red; 
		} 
</style>
<body style="background-color: #FFF9EF;">
<div class="container" id="app" style="padding: 24px 10px;background-color: ;">
    <!-- <header data-am-widget="header" class="am-header am-header-default my-header" style="background-color: #FF9100FF;">
        
        <h1 class="am-header-title">
            <a href="#title-link" class="" style="color: #FFFFFFFF;font-size: 20px;">现场活动</a>
        </h1>
        
    </header> -->
    <!-- <div class="gray-panel" style="padding: 24px 10px;">
        <div class="paoduct-title-panel" style="padding: 24px 10px;">
			<div style="text-align: center;" class="dot">提交成功等待发货<span class="dot-ani"></span></div>
			<div style="text-align: center;">宝励尚善集团欢迎你!</div>
			<div style="text-align: center;"><a href="tel:15736167565">- 联系客户 -</a></div>
			<div style="text-align: center;"></div>
			<div style="text-align: center;">(微信同号)</div>
			<div style="text-align: center;"><img style="width: 100px;height: 100px;"  src="http://qiniu.baoliy168.com/30d5ac6722b02fa11c8229aa23f4175.jpg" /></div>
        </div>
    </div> -->
	<div style="text-align: center;" class="dot"><span style="font-size: 20px;font-weight: bold;">提交成功等待发货</span><span class="dot-ani"></span></div>
	<div style="color: #B1B1B1;font-family: PingFang SC;text-align: center;font-size: 8px;font-weight: 300;line-height: 10px;margin-top: 28px;">ZHUOMAHUA</div>
	<div style="color: #B1B1B1;lfont-family: PingFang SC;text-align: center;font-size: 15px;font-weight: 300;line-height: 17px;margin-top: 4px;">卓玛花欢迎你!</div>
	<div style="text-align: center;margin-top: 37px;"><img style="width: 169px;height: 169px;border: 3px solid #FFA114;"  src="http://qiniu.baoliy168.com/ea99c2e89f10c2063512d2c986a1f9e.png" /></div>
	<div style="font-family: PingFang SC;text-align: center;margin-top: 34px;font-size: 14px;font-weight: 400;line-height: 20px;"><a href="tel:17781264512">- 联系客户 -</a></div>
	<div style="font-family:DIN;text-align: center;margin-top: 9px;font-size: 16px;font-weight: 400;line-height: 20px;vertical-align: 5px;"><a style="font-family:DIN;" href="tel:17781264512">0830-8991188</a></div>
	<hr style="background-color: #FFDFAA;width: 21px;display: block;margin: 0 auto;margin-bottom: 4px;margin-top: 14px;">
	<hr style="background-color: #FFDFAA;width: 14px;display: block;margin: 0 auto;margin-bottom: 4px;">
	<hr style="background-color: #FFDFAA;width: 8px;display: block;margin: 0 auto;">
</div>
</body>
<script src="{{ URL::asset('js/address/distpicker.data.js') }}"></script>
<script src="{{ URL::asset('js/address/distpicker.js') }}"></script>
<script src="{{ URL::asset('js/address/main.js') }}"></script>
<script>
    var app = new Vue({
        el: "#app",
        data: {
            address: {
                'phone':'' ,
                'name':'',
                'sharer_phone':'',
                'sharer_name':'',
                'province':'',
                'city':'',
                'district':'',
                'consignee_adr':'',
                'activity_type':1,
            },
			phone:'' ,
			name:'',
			sharer_phone:'',
			sharer_name:'',
			province:'',
			city:'',
			district:'',
			consignee_adr:'',
			activity_type:1,
        },
        methods: {
            //初始化 系统管理员列表
            initialize:function () {
                //编辑
                var id = this.obtain('id');
                if(id > 0){
                    $.post("/home/member/addaddress",{'_token':'{{csrf_token()}}',id:id,class:'find'},function (res) {
                        if(res.code){
                            app.address = res.data
                            $('#address-form').distpicker('destroy');
                            $("#address-form").distpicker({
                                province: app.address.province,
                                city: app.address.city,
                                district: app.address.district
                            });
                        } else {
                            layer.msg(res.data);
                        }
                    });
                }

            },
            //获取url id
            obtain:function (val) {
                var query = window.location.search.substring(1);
                var vars = query.split("&");
                for (var i=0;i<vars.length;i++) {
                    var pair = vars[i].split("=");
                    if(pair[0] == val){
                        return pair[1];
                    }
                }
            },
            isEmpty:function(obj) {
                if (obj === null) return true;
                if (typeof obj === 'undefined') {
                    return true;
                }
                if (typeof obj === 'string') {
                    if (obj === "") {
                        return true;
                    }
                    var reg = new RegExp("^([ ]+)|([　]+)$");
                    return reg.test(obj);
                }
                return false;
            },
            add:function () {
                app.address.province = $("#province1").val();
                app.address.city = $("#city1").val();
                app.address.district = $("#district1").val();

                // if (app.address.default) {
                //     app.address.default = 1
                // }else {
                //     app.address.default = 0
                // }

                // if( app.isEmpty(app.address.province) ){
                //     layer.msg('请选择所在省份!');
                //     return false;
                // }
                // if( app.isEmpty(app.address.city) ){
                //     layer.msg('请选择所在市!');
                //     return false;
                // }
                // if( app.isEmpty(app.address.district) ){
                //     layer.msg('请选择所在区!');
                //     return false;
                // }
                // if( app.isEmpty(app.address.address) ){
                //     layer.msg('请输入详细地址!');
                //     return false;
                // }
                // if(!(/^[1][3,4,5,7,8,9][0-9]{9}$/.test(app.address.phone))){
                //     layer.msg('请输入正确的电话号码');
                //     return false;
                // }
                $.post("/home/login/InformationEntry",{'_token':'{{csrf_token()}}',class:'add',phone:app.phone,name:app.name,sharer_phone:app.sharer_phone,sharer_name:app.sharer_name,province:app.province,city:app.city,district:app.district,consignee_adr:app.consignee_adr,activity_type:app.activity_type},function (res) {
                    if(res.code){
                        layer.msg(res.data,{time:5000},function () {
                            //window.location.href="http://baicao.baoliy168.com/home/login/login";
                        });
                    } else {
                        layer.msg(res.data);
                    }
                });
            }
        },
        //自动执行
        mounted: function () {
            this.initialize();//分公司
        },
    });
</script>
</html>
